<?php

namespace app\mall\ui\table;

use app\mall\enum\InvoiceStatusEnum;
use app\mall\enum\OpUserEnum;
use app\mall\enum\ScoreEnum;
use suframe\thinkAdmin\ui\table\TableInterface;

/**
 * 发票管理表格
 */
class MallOrderEvaluateTable extends TableInterface
{
    public function header()
    {
        return [
            'id'=> ['label' => 'ID', 'sort' => true, 'fixed' => 'left', 'width' => 70],
            'sn'=> ['label' => '订单号', 'width' => 180],
            'user_type_text'=> ['label' => '角色', 'filter' => OpUserEnum::toZhArray(), 'width' => 80, 'field' => 'user_type'],
            'user_name'=> ['label' => '评价人', 'width' => 120],
            'rate'=> ['label' => '评分', 'filter' => ScoreEnum::toZhArray(), 'width' => 80, 'field' => 'rate'],
            'content'=> ['label' => '评论内容'],
            'images'=> ['label' => '评论图片', 'type' => 'images'],
            'show'=> ['label' => '是否显示', 'type' => 'switch', 'active-value' => 1, 'inactive-value' => 2],
        ];
    }

    public function filters()
    {
        return [
            'sn' => ['label' => '订单号', 'type' => 'text'],
            'user_type' => ['label' => '角色', 'type' => 'text'],
            'uid' => ['label' => '用户uid', 'type' => 'text'],
            'content' => ['label' => '内容模糊查找', 'type' => 'text'],
        ];
    }
}